package 操作文件内容;

import java.io.FileOutputStream;
import java.io.IOException;
import java.io.OutputStream;
import java.io.PrintWriter;

public class FileDemo3_3 {
    //使用 PrintWriter类 包装OutputStream，更方便写入操作
    public static void main(String[] args) {
        try(OutputStream outputStream =new FileOutputStream("./hello.txt")) {
            //使用 PrintWriter类 包装OutputStream
            try(PrintWriter writer=new PrintWriter(outputStream)) {
                writer.println("hello ooooooooo");
                writer.println("你好好");
            }

        }catch (IOException e) {
            e.printStackTrace();
        }
    }

}
